<div class='lv-select-wrapper' [class.disabled]='lvDisabled' #selectWrapper>
    <div class='lv-select-main'>
        <!-- 展示区 -->
        <ng-container *ngIf='empty;else selectionValueTpl'>
            <!-- placeholder -->
            <div class='lv-select-placeholder'>{{lvPlaceholder}}</div>
        </ng-container>
    </div>

    <!-- 删除icon -->
    <div class='lv-select-clear' *ngIf='lvShowClear && !empty' (click)='clearSelected($event)'>
      <div class='lv-select-clear-container'>
        <i lv-icon='lv-icon-clear'></i>
      </div>
    </div>
    
    <!-- 下展icon -->
    <div class='lv-select-operation'>
        <i lv-icon='lv-icon-triangle-down' [lvDisabled]='lvDisabled'></i>
    </div>
</div>

<!-- template -->
<ng-template #selectionValueTpl>
    <div class='lv-select-selection-value'>
        <ng-container *ngTemplateOutlet='!templateMap?.selectTrigger ? optionTpl : customOptionTpl; context: { $implicit: value, name: "selectTrigger" }'>
        </ng-container>
    </div>
</ng-template>

<!-- selection template -->
<!-- options template -->
<ng-template #optionsTemplate>
    <div class='lv-select-panel'>
        <ng-content></ng-content>
    </div>
</ng-template>

<ng-template #normalOptionsTemplate let-options>
    <div class='lv-select-panel' [ngClass]='lvPanelClass' #normalPanel>
        <div class='lv-select-panel-content'>
            <div class='lv-option' [class.selected]='item===value'
                *ngFor='let item of options' (click)='selectOption(item)'>
                <ng-container *ngTemplateOutlet='!templateMap?.option ? optionTpl : customOptionTpl; context: { $implicit: item, name: "option" }'>
                </ng-container>
            </div>
            <div class='lv-select-selection-null' *ngIf='!options?.length'>{{'emptyData'|i18n}}</div>
        </div>
    </div>
</ng-template>

<ng-template #optionTpl let-item>
    {{item}}
</ng-template>

<ng-template #customOptionTpl let-item let-name=name>
    <ng-container *ngTemplateOutlet='templateMap[name];context:{$implicit:item}'
        ></ng-container>
</ng-template>



